/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.io.Serializable;
/**
 * Tabla de rutas programadas. Almacena datos de las distintas rutas por EPV, asignándoles un número de máquinas que deben visitar.
 */
public class Tbv_ruta_programada implements Serializable {
	public Tbv_ruta_programada() {
	}
	
	private java.util.Set this_getSet (int key) {
		if (key == orm.ORMConstants.KEY_TBV_RUTA_PROGRAMADA_TBV_BITACORA_RUTA) {
			return ORM_tbv_bitacora_ruta;
		}
		else if (key == orm.ORMConstants.KEY_TBV_RUTA_PROGRAMADA_TBV_MAQUINA_TBV_RUTA_PROGRAMADA) {
			return ORM_tbv_maquina_tbv_ruta_programada;
		}
		
		return null;
	}
	
	private void this_setOwner(Object owner, int key) {
		if (key == orm.ORMConstants.KEY_TBV_RUTA_PROGRAMADA_TBV_RUTARU_ID_RUTA) {
			this.tbv_rutaru_id_ruta = (orm.Tbv_ruta) owner;
		}
	}
	
	org.orm.util.ORMAdapter _ormAdapter = new org.orm.util.AbstractORMAdapter() {
		public java.util.Set getSet(int key) {
			return this_getSet(key);
		}
		
		public void setOwner(Object owner, int key) {
			this_setOwner(owner, key);
		}
		
	};
	
	private int rp_id_ruta_programada;
	
	private java.util.Date rp_fecha_ruta;
	
	private orm.Tbv_ruta tbv_rutaru_id_ruta;
	
	private java.util.Set ORM_tbv_bitacora_ruta = new java.util.HashSet();
	
	private java.util.Set ORM_tbv_maquina_tbv_ruta_programada = new java.util.HashSet();
	
	private void setRp_id_ruta_programada(int value) {
		this.rp_id_ruta_programada = value;
	}
	
	public int getRp_id_ruta_programada() {
		return rp_id_ruta_programada;
	}
	
	public int getORMID() {
		return getRp_id_ruta_programada();
	}
	
	/**
	 * Fecha en que se realiza la ruta.
	 */
	public void setRp_fecha_ruta(java.util.Date value) {
		this.rp_fecha_ruta = value;
	}
	
	/**
	 * Fecha en que se realiza la ruta.
	 */
	public java.util.Date getRp_fecha_ruta() {
		return rp_fecha_ruta;
	}
	
	public void setTbv_rutaru_id_ruta(orm.Tbv_ruta value) {
		if (tbv_rutaru_id_ruta != null) {
			tbv_rutaru_id_ruta.tbv_ruta_programada.remove(this);
		}
		if (value != null) {
			value.tbv_ruta_programada.add(this);
		}
	}
	
	public orm.Tbv_ruta getTbv_rutaru_id_ruta() {
		return tbv_rutaru_id_ruta;
	}
	
	/**
	 * This method is for internal use only.
	 */
	public void setORM_Tbv_rutaru_id_ruta(orm.Tbv_ruta value) {
		this.tbv_rutaru_id_ruta = value;
	}
	
	private orm.Tbv_ruta getORM_Tbv_rutaru_id_ruta() {
		return tbv_rutaru_id_ruta;
	}
	
	private void setORM_Tbv_bitacora_ruta(java.util.Set value) {
		this.ORM_tbv_bitacora_ruta = value;
	}
	
	private java.util.Set getORM_Tbv_bitacora_ruta() {
		return ORM_tbv_bitacora_ruta;
	}
	
	public final orm.Tbv_bitacora_rutaSetCollection tbv_bitacora_ruta = new orm.Tbv_bitacora_rutaSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_TBV_RUTA_PROGRAMADA_TBV_BITACORA_RUTA, orm.ORMConstants.KEY_TBV_BITACORA_RUTA_TBV_RUTA_PROGRAMADARP_ID_RUTA_PROGRAMADA, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
	
	private void setORM_Tbv_maquina_tbv_ruta_programada(java.util.Set value) {
		this.ORM_tbv_maquina_tbv_ruta_programada = value;
	}
	
	private java.util.Set getORM_Tbv_maquina_tbv_ruta_programada() {
		return ORM_tbv_maquina_tbv_ruta_programada;
	}
	
	public final orm.Tbv_maquina_tbv_ruta_programadaSetCollection tbv_maquina_tbv_ruta_programada = new orm.Tbv_maquina_tbv_ruta_programadaSetCollection(this, _ormAdapter, orm.ORMConstants.KEY_TBV_RUTA_PROGRAMADA_TBV_MAQUINA_TBV_RUTA_PROGRAMADA, orm.ORMConstants.KEY_TBV_MAQUINA_TBV_RUTA_PROGRAMADA_TBV_RUTA_PROGRAMADARP_ID_RUTA_PROGRAMADA, orm.ORMConstants.KEY_MUL_ONE_TO_MANY);
	
	public String toString() {
		return String.valueOf(getRp_id_ruta_programada());
	}
	
}
